<div nz-row>
    <div nz-col nzSpan="8">
        <ng-content #selfDef></ng-content>
        <!-- <button *ngIf="btnShowCheck('add')" nz-button nzType="primary" (click)="addModal()">
            <i nz-icon nzType="plus"></i>新增</button> -->
        <button *ngIf="btnShowCheck('reset')" nz-button nzType="primary" (click)="optAll('reset')">
            <i nz-icon nzType="reload"></i>周计划重置</button>
        <button *ngIf="btnShowCheck('tibao')" nz-button nzType="primary" (click)="optAll('tibao')" nzGhost>
            <i nz-icon nzType="check"></i>提报</button>
        <!-- <button *ngIf="btnShowCheck('delete')" nz-button nzType="primary" (click)="optAll('delete')" nzGhost>
            <i nz-icon nzType="delete"></i>删除</button> -->

        <button *ngIf="btnShowCheck('pizhun')" nz-button nzType="primary" (click)="optAll('pizhun',advice)" nzGhost>
            <i nz-icon nzType="check"></i>批准</button>
        <button *ngIf="btnShowCheck('bohui')" nz-button nzType="primary" (click)="optAll('bohui',advice)" nzGhost>
            <i nz-icon nzType="close"></i>驳回</button>
        <ng-template #advice>
            <textarea nz-input [(ngModel)]="content" [nzAutosize]="{minRows:5}" placeholder="填写审批意见"></textarea>
        </ng-template>

    </div>
    <div nz-col nzSpan="16" style="display: flex;justify-content: flex-end;">
        <nz-month-picker [(ngModel)]="queryData._ym" nzPlaceHolder="选择年月">
        </nz-month-picker>
        <!-- vcYear，vcMonth，vcWeeknum，vcOrg$id -->
        <nz-select [(ngModel)]="queryData.vcWeeknum" style="width: 150px;" nzPlaceHolder="选择周" nzAllowClear="true">
            <nz-option nzLabel="第1周" nzValue="1"></nz-option>
            <nz-option nzLabel="第2周" nzValue="2"></nz-option>
            <nz-option nzLabel="第3周" nzValue="3"></nz-option>
            <nz-option nzLabel="第4周" nzValue="4"></nz-option>
            <nz-option nzLabel="第5周" nzValue="5"></nz-option>
        </nz-select>
        <nz-tree-select [(ngModel)]="queryData.vcOrg$id" [nzDropdownMatchSelectWidth]="false" style="width: 150px"
            nzPlaceHolder="选择部门" [nzDropdownStyle]="{ 'max-height': '300px' }" [nzNodes]="bmList">
        </nz-tree-select>
        <!-- <nz-select *ngIf="queryCmpShowCheck('cjSelect')" [(ngModel)]="queryData.cjorg" style="width: 150px;"
            nzPlaceHolder="选择车间" nzAllowClear="true">
            <nz-option *ngFor="let item of cjList" [nzLabel]="item.opName" [nzValue]="item.opValue">
            </nz-option>
        </nz-select>

        <nz-select *ngIf="queryCmpShowCheck('gqSelect')" [(ngModel)]="queryData.gqorg" style="width: 150px;"
            nzPlaceHolder="选择工区" nzAllowClear="true">
            <nz-option *ngFor="let item of gqList" [nzLabel]="item.opName" [nzValue]="item.opValue">
            </nz-option>
        </nz-select> -->

        <button nz-button nzType="primary" (click)="readyload(1,pageSize)"><i nz-icon nzType="search"></i>查询</button>
    </div>
</div>

<div>
    <nz-table #rowSelectionTable nzSize="small" [nzScroll]="lockHeadScroll" [nzLoadingDelay]="1000"
        [nzShowPagination]="false" [nzFrontPagination]="false" [nzData]="tableData" nzBordered
        [nzLoading]="tableLoading">
        <thead>
            <tr>
                <th nzWidth="50px" nzAlign="center" nzShowCheckbox (nzCheckedChange)="checkAll($event)"></th>
                <th nzWidth="50px" nzAlign="center">序号</th>
                <th nzWidth="100px" nzAlign="center">部门</th>
                <th nzWidth="100px" nzAlign="center">年份</th>
                <th nzWidth="100px" nzAlign="center">月份</th>
                <th nzWidth="100px" nzAlign="center">周次</th>
                <th nzWidth="100px" nzAlign="center">状态</th>
                <th nzWidth="100px" nzAlign="center">审批人</th>
                <th nzWidth="150px" nzAlign="center">审批时间</th>
                <th nzAlign="center">审批意见</th>
                <th nzWidth="100px" nzAlign="center">录入人</th>
                <th nzWidth="150px" nzAlign="center">录入时间</th>
            </tr>
        </thead>
        <tbody>
            <tr *ngFor="let data of rowSelectionTable.data;let i = index" (dblclick)="trDbclick(data)" nz-tooltip
                nzTooltipTitle="双击查看详情" nzTooltipPlacement="bottom" style="cursor:pointer">
                <td nzShowCheckbox [(nzChecked)]="data.checked"></td>
                <td nzAlign="center">{{+i+1}}</td>
                <td nzAlign="center">{{data.vcOrgName}}</td>
                <td>{{data.vcYear}}</td>
                <td nzAlign="center">{{data.vcMonth}}</td>
                <td>{{data.vcWeeknum}}</td>
                <td nzAlign="center">
                    <span class="flowInfo" (click)="hisShow(data)">{{statusList[data.vcStatus]}}</span>
                </td>
                <td>{{data.vcWs$app$per}}</td>
                <td nzAlign="center">{{data.dtWs$app$date}}</td>
                <td>{{data.content}}</td>
                <td>{{data.vcUser$id}}</td>
                <td nzAlign="center">{{data.dtSysdate}}</td>
                <!-- <td><a (click)="hisShow(data)">历史</a></td> -->
            </tr>
        </tbody>
    </nz-table>
</div>
<div style="display: flex;justify-content: space-between;">
    <div style="padding:5px 10px">
        每页
        <nz-select [(ngModel)]="pageSize" (ngModelChange)="pageSizeChange($event)">
            <nz-option nzValue="10" nzLabel="10"></nz-option>
            <nz-option nzValue="50" nzLabel="50"></nz-option>
            <nz-option nzValue="100" nzLabel="100"></nz-option>
            <nz-option nzValue="200" nzLabel="200"></nz-option>
        </nz-select> 条&nbsp;&nbsp;&nbsp;总共<span class="pageTotal">{{pageTotal}}</span>条
    </div>
    <div style="padding:5px 10px">
        <nz-pagination [nzPageSize]="pageSize" [nzPageIndex]="pageIndex" [nzTotal]="pageTotal"
            (nzPageIndexChange)="pageIndexChange($event)"></nz-pagination>
    </div>

</div>



<nz-modal [(nzVisible)]="addVisible" nzTitle="重置" (nzOnCancel)="addCancel()" (nzOnOk)="resetConfirm()">
    <nz-descriptions nzBordered [nzColumn]="1">
        <nz-descriptions-item nzTitle="年月">
            <nz-month-picker [(ngModel)]="addData._ym" nzPlaceHolder="选择年月" (ngModelChange)="ymChange($event)">
            </nz-month-picker>
        </nz-descriptions-item>
        <nz-descriptions-item nzTitle="周次">
            <nz-select [(ngModel)]="addData.weekIdx" (ngModelChange)="weekChange($event)" style="width: 150px;"
                nzPlaceHolder="选择周" nzAllowClear="true">
                <nz-option nzLabel="第1周" nzValue="1"></nz-option>
                <nz-option nzLabel="第2周" nzValue="2"></nz-option>
                <nz-option nzLabel="第3周" nzValue="3"></nz-option>
                <nz-option nzLabel="第4周" nzValue="4"></nz-option>
                <nz-option nzLabel="第5周" nzValue="5"></nz-option>
            </nz-select>
        </nz-descriptions-item>
        <nz-descriptions-item nzTitle="开始日期">
            {{addData._dtWsdate}}
            <!-- <nz-date-picker [(ngModel)]="addData._dtWsdate"></nz-date-picker> -->
        </nz-descriptions-item>
        <nz-descriptions-item nzTitle="结束日期">
            {{addData._dtWedate}}
            <!-- <nz-date-picker [(ngModel)]="addData._dtWedate"></nz-date-picker> -->
        </nz-descriptions-item>
    </nz-descriptions>


</nz-modal>


<nz-modal [(nzVisible)]="hisVisible" nzTitle="历史记录" (nzOnCancel)="hisCancel()" [nzOkText]='null'>
    <nz-table #hisTable nzSize="small" [nzScroll]="lockHeadScroll" [nzLoadingDelay]="1000" [nzShowPagination]="false"
        [nzFrontPagination]="false" [nzData]="hisTableData" nzBordered>
        <thead>
            <tr>
                <th nzWidth="50px" nzAlign="center">序号</th>
                <th nzWidth="150px" nzAlign="center">操作时间</th>
                <th nzWidth="150px" nzAlign="center">操作内容</th>
                <th nzAlign="center">审批意见</th>
            </tr>
        </thead>
        <tbody>
            <tr *ngFor="let data of hisTable.data;let i = index">
                <td nzAlign="center">{{+i+1}}</td>
                <td nzAlign="center">{{data.createdate}}</td>
                <td nzAlign="center">{{data.operate}}</td>
                <td>{{data.content}}</td>
            </tr>
        </tbody>
    </nz-table>
</nz-modal>